<?php

require_once dirname(__FILE__).'/../lib/Predis.php';

class Predis extends Predis\Client {

	protected static $instances = array();

	public static function instance($config = 'predis.default') {
		if (!isset(Predis::$instances[$config])) {
			// Create a new instance
			Predis::$instances[$config] = new Predis(Kohana::config($config));
		}

		return Predis::$instances[$config];
	}
}
